//
//  Home_DetailHeaderView.m
//  HappyRent
//
//  Created by CoderYee on 2017/4/7.
//  Copyright © 2017年 内圈科技. All rights reserved.
//

#import "Home_DetailHeaderView.h"
@interface Home_DetailHeaderView ()<SDCycleScrollViewDelegate>
{
    
    SDCycleScrollView    *_bannerView;
}

@end
@implementation Home_DetailHeaderView

-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self=[super initWithFrame:frame]) {
        
        [self addOwnView];
    }
    return self;
    
}

-(void)addOwnView{
    
    [self setBackgroundColor:kWhiteColor];
    [self addBannerView];
    [self addOtherView];
    
}
#pragma mark 添加子类控件
-(void)addOtherView{
    
    _avorImageView=[[UIImageView alloc] init];
    _avorImageView.contentMode=UIViewContentModeScaleAspectFill;
    _avorImageView.clipsToBounds=YES;
    [_avorImageView setImage:[UIImage imageNamed:@"baoming2"]];
    _avorImageView.layer.masksToBounds=YES;
    _avorImageView.layer.cornerRadius=20.0f;
    [self addSubview:_avorImageView];
    [_avorImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.width.mas_equalTo(40);
        make.right.equalTo(self).with.offset(-10);
        make.top.equalTo(_bannerView.mas_bottom).offset(10);
    }];
    
    
    _houseLable=[[UILabel alloc] init];
    _houseLable.text=@"北京京北京京北京京北京京北京京北京京北京京北京京北京京北京京北京京";
    _houseLable.textColor=kBlackColor;
    _houseLable.numberOfLines=0;
    _houseLable.font=boldfont(15);
    [self addSubview:_houseLable];
    [_houseLable mas_makeConstraints:^(MASConstraintMaker *make) {
    
        make.centerY.equalTo(_avorImageView.mas_centerY);
        make.left.equalTo(self).with.offset(15);
        make.right.equalTo(_avorImageView.mas_left);
    }];
    
}
-(void)addBannerView{
    
    SDCycleScrollView  *bannerHeaderView=[SDCycleScrollView  cycleScrollViewWithFrame:CGRectMake(0, 0, kMainScreenWidth,kMainScreenWidth*0.5) delegate:self placeholderImage:[UIImage imageNamed:@"activity_default"]];
    bannerHeaderView.pageControlStyle=SDCycleScrollViewPageContolStyleClassic;
    bannerHeaderView.bannerImageViewContentMode=UIViewContentModeScaleAspectFill;
    bannerHeaderView.pageDotColor=kWhiteColor;
    [bannerHeaderView setBackgroundColor:kWhiteColor];
    bannerHeaderView.pageDotImage=[UIImage imageNamed:@"HX_Banner_dot_nor"];
    bannerHeaderView.currentPageDotImage=[UIImage imageNamed:@"HX_Banner_dot_current"];
    bannerHeaderView.currentPageDotColor=kNavBarThemeColor;
    bannerHeaderView.imageURLStringsGroup=@[@"http://upload-images.jianshu.io/upload_images/4437256-06caaaf1a727d53c.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240",@"http://upload-images.jianshu.io/upload_images/3534836-ceb716b394ae8a63.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240",@"http://upload-images.jianshu.io/upload_images/2542851-f0a8d9158f461b8b.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240"];
    _bannerView=bannerHeaderView;
    [self addSubview:bannerHeaderView];
}
@end
